package com.china08.yxyapi.util;

// 处理字符串中的空格
public class StringTrimUtil {

    public static String trim(String string) {
        string = string.trim();
        // if (StringUtils.isBlank(string)) { return ""; }
        // string = StringUtils.trim(string);
        // string = string.replaceAll(" ", "");
        // string = string.replaceAll("\\s*", "");
        return string;
    }

    public static String disDuration(Integer miao) {
        if (miao == null || miao < 0) {
            miao = 0;
        }
        try {
            int h = miao / 3600;
            int m = (miao % 3600) / 60;
            int s = (miao % 3600) % 60;
            if (h > 0) {
                return (h + "时" + m + "分" + s + "秒");
            } else {
                if (m > 0) {
                    return (m + "分" + s + "秒");
                } else {
                    return (s + "秒");
                }
            }
        } catch (Exception e) {
            return "";
        }
    }
}
